# Contributor: Dennis Krupenik <dennis@krupenik.com>
# Maintainer: Dennis Krupenik <dennis@krupenik.com>
pkgname=igt-gpu-tools
pkgver=1.25
pkgrel=2
pkgdesc="collection of tools for development and testing of the DRM drivers"
url="https://gitlab.freedesktop.org/drm/igt-gpu-tools/"
arch="x86_64" # Mostly used for Intel integrated GPUs
license="MIT"
depends_dev="alsa-lib-dev cairo-dev curl-dev elfutils-dev eudev-dev gsl-dev
	json-c-dev kmod-dev libdrm-dev liboping-dev libpciaccess-dev libunwind-dev
	libxrandr-dev libxv-dev pixman-dev procps-dev xmlrpc-c-dev"
makedepends="bison flex meson $depends_dev"
subpackages="$pkgname-dev"
source="https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/igt-gpu-tools-$pkgver/igt-gpu-tools-igt-gpu-tools-$pkgver.tar.bz2
	bash-sh.patch
	musl.patch
	fix-meson.patch
	hdmi-vsdb-struct-padding-fix.patch
	"
builddir="$srcdir/igt-gpu-tools-igt-gpu-tools-$pkgver"

build() {
	abuild-meson \
		-Dvalgrind=disabled \
		. build
	meson compile ${JOBS:+-j ${JOBS}} -C build
}

check() {
	meson test --no-rebuild -v -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

sha512sums="
47a31c0af733e9481e3e8e718adede0a05cb04064d80dae6a7753a346deb71333fb8310664084f4dddfec957629e93c188bc44f2a6895744a10107e4823a9ee6  igt-gpu-tools-igt-gpu-tools-1.25.tar.bz2
0e24d93cdc56517c78fbcdc64dac63067c9cf49bed66e3b2b6dec6111d67c7e27a2ad7ddb9f1e373746b4b8e9e3535993f8261800fc3729d1f2cdef37e392fc5  bash-sh.patch
a79a3d4134a75e450b18188189614ad0b3d4218007c8ce68c74f5a928258ca8838ccce5c1f64f920038c44e188896d8d504a36e3cbdf1f8f16c3904bb3b9955f  musl.patch
f843466a5a48229a420ef2df665bf97ad3af120bb50d1de9cab8ad5390f5d2a80df1346f59b90c8e6fc6a211271e56e5dee67c09c42901b1eeb7370d7feff7ca  fix-meson.patch
e217d4a1f8e9c19d1b5110a4a3c91c70f1e93523e3ad4d98068ef6b9aa5a4e3b1c3e48aa4930d70d6a132e869f760795ba5395117dc6461d3505ed12b98a2c70  hdmi-vsdb-struct-padding-fix.patch
"
